<?php


abstract class BaseDatos extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $cedula;


	
	protected $nombre;


	
	protected $apellido;


	
	protected $fechanan;


	
	protected $edocivil;


	
	protected $dir;


	
	protected $sector;


	
	protected $casa;


	
	protected $telf;


	
	protected $cel;


	
	protected $tpzona;


	
	protected $nacionalidad;


	
	protected $edad;


	
	protected $sexo;


	
	protected $correo;


	
	protected $ocupacion;


	
	protected $jefe;


	
	protected $trabaja;


	
	protected $cod_fam;


	
	protected $ing_mensual;


	
	protected $instruccion;

	
	protected $collJefes;

	
	protected $lastJefeCriteria = null;

	
	protected $collHistorias;

	
	protected $lastHistoriaCriteria = null;

	
	protected $collInfante_pers;

	
	protected $lastInfante_perCriteria = null;

	
	protected $collDat_infantes;

	
	protected $lastDat_infanteCriteria = null;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getCedula()
	{

		return $this->cedula;
	}

	
	public function getNombre()
	{

		return $this->nombre;
	}

	
	public function getApellido()
	{

		return $this->apellido;
	}

	
	public function getFechanan($format = 'Y-m-d')
	{

		if ($this->fechanan === null || $this->fechanan === '') {
			return null;
		} elseif (!is_int($this->fechanan)) {
						$ts = strtotime($this->fechanan);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [fechanan] as date/time value: " . var_export($this->fechanan, true));
			}
		} else {
			$ts = $this->fechanan;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getEdocivil()
	{

		return $this->edocivil;
	}

	
	public function getDir()
	{

		return $this->dir;
	}

	
	public function getSector()
	{

		return $this->sector;
	}

	
	public function getCasa()
	{

		return $this->casa;
	}

	
	public function getTelf()
	{

		return $this->telf;
	}

	
	public function getCel()
	{

		return $this->cel;
	}

	
	public function getTpzona()
	{

		return $this->tpzona;
	}

	
	public function getNacionalidad()
	{

		return $this->nacionalidad;
	}

	
	public function getEdad()
	{

		return $this->edad;
	}

	
	public function getSexo()
	{

		return $this->sexo;
	}

	
	public function getCorreo()
	{

		return $this->correo;
	}

	
	public function getOcupacion()
	{

		return $this->ocupacion;
	}

	
	public function getJefe()
	{

		return $this->jefe;
	}

	
	public function getTrabaja()
	{

		return $this->trabaja;
	}

	
	public function getCodFam()
	{

		return $this->cod_fam;
	}

	
	public function getIngMensual()
	{

		return $this->ing_mensual;
	}

	
	public function getInstruccion()
	{

		return $this->instruccion;
	}

	
	public function setCedula($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->cedula !== $v) {
			$this->cedula = $v;
			$this->modifiedColumns[] = DatosPeer::CEDULA;
		}

	} 
	
	public function setNombre($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->nombre !== $v) {
			$this->nombre = $v;
			$this->modifiedColumns[] = DatosPeer::NOMBRE;
		}

	} 
	
	public function setApellido($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->apellido !== $v) {
			$this->apellido = $v;
			$this->modifiedColumns[] = DatosPeer::APELLIDO;
		}

	} 
	
	public function setFechanan($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [fechanan] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->fechanan !== $ts) {
			$this->fechanan = $ts;
			$this->modifiedColumns[] = DatosPeer::FECHANAN;
		}

	} 
	
	public function setEdocivil($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->edocivil !== $v) {
			$this->edocivil = $v;
			$this->modifiedColumns[] = DatosPeer::EDOCIVIL;
		}

	} 
	
	public function setDir($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->dir !== $v) {
			$this->dir = $v;
			$this->modifiedColumns[] = DatosPeer::DIR;
		}

	} 
	
	public function setSector($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->sector !== $v) {
			$this->sector = $v;
			$this->modifiedColumns[] = DatosPeer::SECTOR;
		}

	} 
	
	public function setCasa($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->casa !== $v) {
			$this->casa = $v;
			$this->modifiedColumns[] = DatosPeer::CASA;
		}

	} 
	
	public function setTelf($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->telf !== $v) {
			$this->telf = $v;
			$this->modifiedColumns[] = DatosPeer::TELF;
		}

	} 
	
	public function setCel($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->cel !== $v) {
			$this->cel = $v;
			$this->modifiedColumns[] = DatosPeer::CEL;
		}

	} 
	
	public function setTpzona($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->tpzona !== $v) {
			$this->tpzona = $v;
			$this->modifiedColumns[] = DatosPeer::TPZONA;
		}

	} 
	
	public function setNacionalidad($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->nacionalidad !== $v) {
			$this->nacionalidad = $v;
			$this->modifiedColumns[] = DatosPeer::NACIONALIDAD;
		}

	} 
	
	public function setEdad($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->edad !== $v) {
			$this->edad = $v;
			$this->modifiedColumns[] = DatosPeer::EDAD;
		}

	} 
	
	public function setSexo($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->sexo !== $v) {
			$this->sexo = $v;
			$this->modifiedColumns[] = DatosPeer::SEXO;
		}

	} 
	
	public function setCorreo($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->correo !== $v) {
			$this->correo = $v;
			$this->modifiedColumns[] = DatosPeer::CORREO;
		}

	} 
	
	public function setOcupacion($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->ocupacion !== $v) {
			$this->ocupacion = $v;
			$this->modifiedColumns[] = DatosPeer::OCUPACION;
		}

	} 
	
	public function setJefe($v)
	{

		if ($this->jefe !== $v) {
			$this->jefe = $v;
			$this->modifiedColumns[] = DatosPeer::JEFE;
		}

	} 
	
	public function setTrabaja($v)
	{

		if ($this->trabaja !== $v) {
			$this->trabaja = $v;
			$this->modifiedColumns[] = DatosPeer::TRABAJA;
		}

	} 
	
	public function setCodFam($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->cod_fam !== $v) {
			$this->cod_fam = $v;
			$this->modifiedColumns[] = DatosPeer::COD_FAM;
		}

	} 
	
	public function setIngMensual($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->ing_mensual !== $v) {
			$this->ing_mensual = $v;
			$this->modifiedColumns[] = DatosPeer::ING_MENSUAL;
		}

	} 
	
	public function setInstruccion($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->instruccion !== $v) {
			$this->instruccion = $v;
			$this->modifiedColumns[] = DatosPeer::INSTRUCCION;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->cedula = $rs->getString($startcol + 0);

			$this->nombre = $rs->getString($startcol + 1);

			$this->apellido = $rs->getString($startcol + 2);

			$this->fechanan = $rs->getDate($startcol + 3, null);

			$this->edocivil = $rs->getString($startcol + 4);

			$this->dir = $rs->getString($startcol + 5);

			$this->sector = $rs->getString($startcol + 6);

			$this->casa = $rs->getString($startcol + 7);

			$this->telf = $rs->getString($startcol + 8);

			$this->cel = $rs->getString($startcol + 9);

			$this->tpzona = $rs->getString($startcol + 10);

			$this->nacionalidad = $rs->getString($startcol + 11);

			$this->edad = $rs->getInt($startcol + 12);

			$this->sexo = $rs->getString($startcol + 13);

			$this->correo = $rs->getString($startcol + 14);

			$this->ocupacion = $rs->getString($startcol + 15);

			$this->jefe = $rs->getBoolean($startcol + 16);

			$this->trabaja = $rs->getBoolean($startcol + 17);

			$this->cod_fam = $rs->getInt($startcol + 18);

			$this->ing_mensual = $rs->getString($startcol + 19);

			$this->instruccion = $rs->getString($startcol + 20);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 21; 
		} catch (Exception $e) {
			throw new PropelException("Error populating Datos object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(DatosPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			DatosPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(DatosPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = DatosPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setNew(false);
				} else {
					$affectedRows += DatosPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			if ($this->collJefes !== null) {
				foreach($this->collJefes as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collHistorias !== null) {
				foreach($this->collHistorias as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collInfante_pers !== null) {
				foreach($this->collInfante_pers as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collDat_infantes !== null) {
				foreach($this->collDat_infantes as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


			if (($retval = DatosPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}


				if ($this->collJefes !== null) {
					foreach($this->collJefes as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collHistorias !== null) {
					foreach($this->collHistorias as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collInfante_pers !== null) {
					foreach($this->collInfante_pers as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collDat_infantes !== null) {
					foreach($this->collDat_infantes as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}


			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = DatosPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getCedula();
				break;
			case 1:
				return $this->getNombre();
				break;
			case 2:
				return $this->getApellido();
				break;
			case 3:
				return $this->getFechanan();
				break;
			case 4:
				return $this->getEdocivil();
				break;
			case 5:
				return $this->getDir();
				break;
			case 6:
				return $this->getSector();
				break;
			case 7:
				return $this->getCasa();
				break;
			case 8:
				return $this->getTelf();
				break;
			case 9:
				return $this->getCel();
				break;
			case 10:
				return $this->getTpzona();
				break;
			case 11:
				return $this->getNacionalidad();
				break;
			case 12:
				return $this->getEdad();
				break;
			case 13:
				return $this->getSexo();
				break;
			case 14:
				return $this->getCorreo();
				break;
			case 15:
				return $this->getOcupacion();
				break;
			case 16:
				return $this->getJefe();
				break;
			case 17:
				return $this->getTrabaja();
				break;
			case 18:
				return $this->getCodFam();
				break;
			case 19:
				return $this->getIngMensual();
				break;
			case 20:
				return $this->getInstruccion();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = DatosPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getCedula(),
			$keys[1] => $this->getNombre(),
			$keys[2] => $this->getApellido(),
			$keys[3] => $this->getFechanan(),
			$keys[4] => $this->getEdocivil(),
			$keys[5] => $this->getDir(),
			$keys[6] => $this->getSector(),
			$keys[7] => $this->getCasa(),
			$keys[8] => $this->getTelf(),
			$keys[9] => $this->getCel(),
			$keys[10] => $this->getTpzona(),
			$keys[11] => $this->getNacionalidad(),
			$keys[12] => $this->getEdad(),
			$keys[13] => $this->getSexo(),
			$keys[14] => $this->getCorreo(),
			$keys[15] => $this->getOcupacion(),
			$keys[16] => $this->getJefe(),
			$keys[17] => $this->getTrabaja(),
			$keys[18] => $this->getCodFam(),
			$keys[19] => $this->getIngMensual(),
			$keys[20] => $this->getInstruccion(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = DatosPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setCedula($value);
				break;
			case 1:
				$this->setNombre($value);
				break;
			case 2:
				$this->setApellido($value);
				break;
			case 3:
				$this->setFechanan($value);
				break;
			case 4:
				$this->setEdocivil($value);
				break;
			case 5:
				$this->setDir($value);
				break;
			case 6:
				$this->setSector($value);
				break;
			case 7:
				$this->setCasa($value);
				break;
			case 8:
				$this->setTelf($value);
				break;
			case 9:
				$this->setCel($value);
				break;
			case 10:
				$this->setTpzona($value);
				break;
			case 11:
				$this->setNacionalidad($value);
				break;
			case 12:
				$this->setEdad($value);
				break;
			case 13:
				$this->setSexo($value);
				break;
			case 14:
				$this->setCorreo($value);
				break;
			case 15:
				$this->setOcupacion($value);
				break;
			case 16:
				$this->setJefe($value);
				break;
			case 17:
				$this->setTrabaja($value);
				break;
			case 18:
				$this->setCodFam($value);
				break;
			case 19:
				$this->setIngMensual($value);
				break;
			case 20:
				$this->setInstruccion($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = DatosPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setCedula($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setNombre($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setApellido($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setFechanan($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setEdocivil($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setDir($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setSector($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setCasa($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setTelf($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setCel($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setTpzona($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setNacionalidad($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setEdad($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setSexo($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setCorreo($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setOcupacion($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setJefe($arr[$keys[16]]);
		if (array_key_exists($keys[17], $arr)) $this->setTrabaja($arr[$keys[17]]);
		if (array_key_exists($keys[18], $arr)) $this->setCodFam($arr[$keys[18]]);
		if (array_key_exists($keys[19], $arr)) $this->setIngMensual($arr[$keys[19]]);
		if (array_key_exists($keys[20], $arr)) $this->setInstruccion($arr[$keys[20]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(DatosPeer::DATABASE_NAME);

		if ($this->isColumnModified(DatosPeer::CEDULA)) $criteria->add(DatosPeer::CEDULA, $this->cedula);
		if ($this->isColumnModified(DatosPeer::NOMBRE)) $criteria->add(DatosPeer::NOMBRE, $this->nombre);
		if ($this->isColumnModified(DatosPeer::APELLIDO)) $criteria->add(DatosPeer::APELLIDO, $this->apellido);
		if ($this->isColumnModified(DatosPeer::FECHANAN)) $criteria->add(DatosPeer::FECHANAN, $this->fechanan);
		if ($this->isColumnModified(DatosPeer::EDOCIVIL)) $criteria->add(DatosPeer::EDOCIVIL, $this->edocivil);
		if ($this->isColumnModified(DatosPeer::DIR)) $criteria->add(DatosPeer::DIR, $this->dir);
		if ($this->isColumnModified(DatosPeer::SECTOR)) $criteria->add(DatosPeer::SECTOR, $this->sector);
		if ($this->isColumnModified(DatosPeer::CASA)) $criteria->add(DatosPeer::CASA, $this->casa);
		if ($this->isColumnModified(DatosPeer::TELF)) $criteria->add(DatosPeer::TELF, $this->telf);
		if ($this->isColumnModified(DatosPeer::CEL)) $criteria->add(DatosPeer::CEL, $this->cel);
		if ($this->isColumnModified(DatosPeer::TPZONA)) $criteria->add(DatosPeer::TPZONA, $this->tpzona);
		if ($this->isColumnModified(DatosPeer::NACIONALIDAD)) $criteria->add(DatosPeer::NACIONALIDAD, $this->nacionalidad);
		if ($this->isColumnModified(DatosPeer::EDAD)) $criteria->add(DatosPeer::EDAD, $this->edad);
		if ($this->isColumnModified(DatosPeer::SEXO)) $criteria->add(DatosPeer::SEXO, $this->sexo);
		if ($this->isColumnModified(DatosPeer::CORREO)) $criteria->add(DatosPeer::CORREO, $this->correo);
		if ($this->isColumnModified(DatosPeer::OCUPACION)) $criteria->add(DatosPeer::OCUPACION, $this->ocupacion);
		if ($this->isColumnModified(DatosPeer::JEFE)) $criteria->add(DatosPeer::JEFE, $this->jefe);
		if ($this->isColumnModified(DatosPeer::TRABAJA)) $criteria->add(DatosPeer::TRABAJA, $this->trabaja);
		if ($this->isColumnModified(DatosPeer::COD_FAM)) $criteria->add(DatosPeer::COD_FAM, $this->cod_fam);
		if ($this->isColumnModified(DatosPeer::ING_MENSUAL)) $criteria->add(DatosPeer::ING_MENSUAL, $this->ing_mensual);
		if ($this->isColumnModified(DatosPeer::INSTRUCCION)) $criteria->add(DatosPeer::INSTRUCCION, $this->instruccion);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(DatosPeer::DATABASE_NAME);

		$criteria->add(DatosPeer::CEDULA, $this->cedula);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getCedula();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setCedula($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setNombre($this->nombre);

		$copyObj->setApellido($this->apellido);

		$copyObj->setFechanan($this->fechanan);

		$copyObj->setEdocivil($this->edocivil);

		$copyObj->setDir($this->dir);

		$copyObj->setSector($this->sector);

		$copyObj->setCasa($this->casa);

		$copyObj->setTelf($this->telf);

		$copyObj->setCel($this->cel);

		$copyObj->setTpzona($this->tpzona);

		$copyObj->setNacionalidad($this->nacionalidad);

		$copyObj->setEdad($this->edad);

		$copyObj->setSexo($this->sexo);

		$copyObj->setCorreo($this->correo);

		$copyObj->setOcupacion($this->ocupacion);

		$copyObj->setJefe($this->jefe);

		$copyObj->setTrabaja($this->trabaja);

		$copyObj->setCodFam($this->cod_fam);

		$copyObj->setIngMensual($this->ing_mensual);

		$copyObj->setInstruccion($this->instruccion);


		if ($deepCopy) {
									$copyObj->setNew(false);

			foreach($this->getJefes() as $relObj) {
				$copyObj->addJefe($relObj->copy($deepCopy));
			}

			foreach($this->getHistorias() as $relObj) {
				$copyObj->addHistoria($relObj->copy($deepCopy));
			}

			foreach($this->getInfante_pers() as $relObj) {
				$copyObj->addInfante_per($relObj->copy($deepCopy));
			}

			foreach($this->getDat_infantes() as $relObj) {
				$copyObj->addDat_infante($relObj->copy($deepCopy));
			}

		} 

		$copyObj->setNew(true);

		$copyObj->setCedula(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new DatosPeer();
		}
		return self::$peer;
	}

	
	public function initJefes()
	{
		if ($this->collJefes === null) {
			$this->collJefes = array();
		}
	}

	
	public function getJefes($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collJefes === null) {
			if ($this->isNew()) {
			   $this->collJefes = array();
			} else {

				$criteria->add(JefePeer::CEDULA, $this->getCedula());

				JefePeer::addSelectColumns($criteria);
				$this->collJefes = JefePeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(JefePeer::CEDULA, $this->getCedula());

				JefePeer::addSelectColumns($criteria);
				if (!isset($this->lastJefeCriteria) || !$this->lastJefeCriteria->equals($criteria)) {
					$this->collJefes = JefePeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastJefeCriteria = $criteria;
		return $this->collJefes;
	}

	
	public function countJefes($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(JefePeer::CEDULA, $this->getCedula());

		return JefePeer::doCount($criteria, $distinct, $con);
	}

	
	public function addJefe(Jefe $l)
	{
		$this->collJefes[] = $l;
		$l->setDatos($this);
	}

	
	public function initHistorias()
	{
		if ($this->collHistorias === null) {
			$this->collHistorias = array();
		}
	}

	
	public function getHistorias($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHistorias === null) {
			if ($this->isNew()) {
			   $this->collHistorias = array();
			} else {

				$criteria->add(HistoriaPeer::CEDULA, $this->getCedula());

				HistoriaPeer::addSelectColumns($criteria);
				$this->collHistorias = HistoriaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(HistoriaPeer::CEDULA, $this->getCedula());

				HistoriaPeer::addSelectColumns($criteria);
				if (!isset($this->lastHistoriaCriteria) || !$this->lastHistoriaCriteria->equals($criteria)) {
					$this->collHistorias = HistoriaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastHistoriaCriteria = $criteria;
		return $this->collHistorias;
	}

	
	public function countHistorias($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(HistoriaPeer::CEDULA, $this->getCedula());

		return HistoriaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addHistoria(Historia $l)
	{
		$this->collHistorias[] = $l;
		$l->setDatos($this);
	}

	
	public function initInfante_pers()
	{
		if ($this->collInfante_pers === null) {
			$this->collInfante_pers = array();
		}
	}

	
	public function getInfante_pers($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collInfante_pers === null) {
			if ($this->isNew()) {
			   $this->collInfante_pers = array();
			} else {

				$criteria->add(Infante_perPeer::COD_FAMILIA, $this->getCodFam());

				Infante_perPeer::addSelectColumns($criteria);
				$this->collInfante_pers = Infante_perPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(Infante_perPeer::COD_FAMILIA, $this->getCodFam());

				Infante_perPeer::addSelectColumns($criteria);
				if (!isset($this->lastInfante_perCriteria) || !$this->lastInfante_perCriteria->equals($criteria)) {
					$this->collInfante_pers = Infante_perPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastInfante_perCriteria = $criteria;
		return $this->collInfante_pers;
	}

	
	public function countInfante_pers($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(Infante_perPeer::COD_FAMILIA, $this->getCodFam());

		return Infante_perPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addInfante_per(Infante_per $l)
	{
		$this->collInfante_pers[] = $l;
		$l->setDatos($this);
	}


	
	public function getInfante_persJoinHistoria($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collInfante_pers === null) {
			if ($this->isNew()) {
				$this->collInfante_pers = array();
			} else {

				$criteria->add(Infante_perPeer::COD_FAMILIA, $this->getCodFam());

				$this->collInfante_pers = Infante_perPeer::doSelectJoinHistoria($criteria, $con);
			}
		} else {
									
			$criteria->add(Infante_perPeer::COD_FAMILIA, $this->getCodFam());

			if (!isset($this->lastInfante_perCriteria) || !$this->lastInfante_perCriteria->equals($criteria)) {
				$this->collInfante_pers = Infante_perPeer::doSelectJoinHistoria($criteria, $con);
			}
		}
		$this->lastInfante_perCriteria = $criteria;

		return $this->collInfante_pers;
	}

	
	public function initDat_infantes()
	{
		if ($this->collDat_infantes === null) {
			$this->collDat_infantes = array();
		}
	}

	
	public function getDat_infantes($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collDat_infantes === null) {
			if ($this->isNew()) {
			   $this->collDat_infantes = array();
			} else {

				$criteria->add(Dat_infantePeer::COD_FAMILIA, $this->getCodFam());

				Dat_infantePeer::addSelectColumns($criteria);
				$this->collDat_infantes = Dat_infantePeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(Dat_infantePeer::COD_FAMILIA, $this->getCodFam());

				Dat_infantePeer::addSelectColumns($criteria);
				if (!isset($this->lastDat_infanteCriteria) || !$this->lastDat_infanteCriteria->equals($criteria)) {
					$this->collDat_infantes = Dat_infantePeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastDat_infanteCriteria = $criteria;
		return $this->collDat_infantes;
	}

	
	public function countDat_infantes($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(Dat_infantePeer::COD_FAMILIA, $this->getCodFam());

		return Dat_infantePeer::doCount($criteria, $distinct, $con);
	}

	
	public function addDat_infante(Dat_infante $l)
	{
		$this->collDat_infantes[] = $l;
		$l->setDatos($this);
	}

} 